package com.cskaoyan.controller;


import com.cskaoyan.bean.adminmanagementbo.*;
import com.cskaoyan.bean.adminmanagementvo.*;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.service.AdminManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建日期: 2022/05/05 23:15
 *
 * @author shuyang
 */
@RestController
@RequestMapping("admin")
public class AdminManagementController {
    @Autowired
    AdminManagementService adminManagementService;

    //主页
    @GetMapping("dashboard")
    public BaseRespVo<DashboardVO> dashboard() {
        DashboardVO dashboardVO = adminManagementService.queryTotals();
        return BaseRespVo.ok(dashboardVO);
    }

    //收货地址
    @GetMapping("address/list")
    public BaseRespVo<AddressListVO> queryAddressList(AddressListBO addressListBO) {
        AddressListVO addressListVO = adminManagementService.queryAddress(addressListBO);
        return BaseRespVo.ok(addressListVO);
    }

    //会员收藏
    @GetMapping("collect/list")
    public BaseRespVo<CollectListVO> queryCollectList(CollectListBO collectListBO) {
        CollectListVO collectListVO = adminManagementService.selectCollects(collectListBO);
        return BaseRespVo.ok(collectListVO);
    }

    //会员足迹
    @GetMapping("footprint/list")
    public BaseRespVo<FootprintListVO> queryFootprintList(FootprintListBo footprintListBo) {
        FootprintListVO footprintListVO = adminManagementService.selectFootprints(footprintListBo);
        return BaseRespVo.ok(footprintListVO);
    }

    //搜索历史
    @GetMapping("history/list")
    public BaseRespVo<HistoryListVO> queryHistoryList(HistoryListBO historyListBO) {
        HistoryListVO historyListVO = adminManagementService.selectHistories(historyListBO);
        return BaseRespVo.ok(historyListVO);
    }

    //意见反馈
    @GetMapping("feedback/list")
    public BaseRespVo<FeedbackVO> queryFeedbackList(FeedbackBO feedbackBO) {
        FeedbackVO feedbackVO = adminManagementService.selectFeedbacks(feedbackBO);
        return BaseRespVo.ok(feedbackVO);
    }
}
